(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
qsort(nil) → nil
qsort(.(x, y)) → ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) → nil
lowers(x, .(y, z)) → if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) → nil
greaters(x, .(y, z)) → if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(2n):
The rewrite sequence
lowers(x, .(y, z)) →+ if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
gives rise to a decreasing loop by considering the right hand sides subterm at position [1,1].
The pumping substitution is [z / .(y, z)].
The result substitution is [ ].
The rewrite sequence
lowers(x, .(y, z)) →+ if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
gives rise to a decreasing loop by considering the right hand sides subterm at position [2].
The pumping substitution is [z / .(y, z)].
The result substitution is [ ].
(2) BOUNDS(2^n, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
qsort(nil) → nil
qsort(.(x, y)) → ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) → nil
lowers(x, .(y, z)) → if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) → nil
greaters(x, .(y, z)) → if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
qsort(nil) → nil
qsort(.(x, y)) → ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) → nil
lowers(x, .(y, z)) → if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) → nil
greaters(x, .(y, z)) → if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))
Types:
qsort :: nil:.:++:if → nil:.:++:if
nil :: nil:.:++:if
. :: a → nil:.:++:if → nil:.:++:if
++ :: nil:.:++:if → nil:.:++:if → nil:.:++:if
lowers :: a → nil:.:++:if → nil:.:++:if
greaters :: a → nil:.:++:if → nil:.:++:if
if :: <= → nil:.:++:if → nil:.:++:if → nil:.:++:if
<= :: a → a → <=
hole_nil:.:++:if1_0 :: nil:.:++:if
hole_a2_0 :: a
hole_<=3_0 :: <=
gen_nil:.:++:if4_0 :: Nat → nil:.:++:if
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
qsort,
lowers,
greatersThey will be analysed ascendingly in the following order:
lowers < qsort
greaters < qsort
(8) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
.(
x,
y)) →
++(
qsort(
lowers(
x,
y)),
.(
x,
qsort(
greaters(
x,
y))))
lowers(
x,
nil) →
nillowers(
x,
.(
y,
z)) →
if(
<=(
y,
x),
.(
y,
lowers(
x,
z)),
lowers(
x,
z))
greaters(
x,
nil) →
nilgreaters(
x,
.(
y,
z)) →
if(
<=(
y,
x),
greaters(
x,
z),
.(
y,
greaters(
x,
z)))
Types:
qsort :: nil:.:++:if → nil:.:++:if
nil :: nil:.:++:if
. :: a → nil:.:++:if → nil:.:++:if
++ :: nil:.:++:if → nil:.:++:if → nil:.:++:if
lowers :: a → nil:.:++:if → nil:.:++:if
greaters :: a → nil:.:++:if → nil:.:++:if
if :: <= → nil:.:++:if → nil:.:++:if → nil:.:++:if
<= :: a → a → <=
hole_nil:.:++:if1_0 :: nil:.:++:if
hole_a2_0 :: a
hole_<=3_0 :: <=
gen_nil:.:++:if4_0 :: Nat → nil:.:++:if
Generator Equations:
gen_nil:.:++:if4_0(0) ⇔ nil
gen_nil:.:++:if4_0(+(x, 1)) ⇔ .(hole_a2_0, gen_nil:.:++:if4_0(x))
The following defined symbols remain to be analysed:
lowers, qsort, greaters
They will be analysed ascendingly in the following order:
lowers < qsort
greaters < qsort
(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol lowers.
(10) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
.(
x,
y)) →
++(
qsort(
lowers(
x,
y)),
.(
x,
qsort(
greaters(
x,
y))))
lowers(
x,
nil) →
nillowers(
x,
.(
y,
z)) →
if(
<=(
y,
x),
.(
y,
lowers(
x,
z)),
lowers(
x,
z))
greaters(
x,
nil) →
nilgreaters(
x,
.(
y,
z)) →
if(
<=(
y,
x),
greaters(
x,
z),
.(
y,
greaters(
x,
z)))
Types:
qsort :: nil:.:++:if → nil:.:++:if
nil :: nil:.:++:if
. :: a → nil:.:++:if → nil:.:++:if
++ :: nil:.:++:if → nil:.:++:if → nil:.:++:if
lowers :: a → nil:.:++:if → nil:.:++:if
greaters :: a → nil:.:++:if → nil:.:++:if
if :: <= → nil:.:++:if → nil:.:++:if → nil:.:++:if
<= :: a → a → <=
hole_nil:.:++:if1_0 :: nil:.:++:if
hole_a2_0 :: a
hole_<=3_0 :: <=
gen_nil:.:++:if4_0 :: Nat → nil:.:++:if
Generator Equations:
gen_nil:.:++:if4_0(0) ⇔ nil
gen_nil:.:++:if4_0(+(x, 1)) ⇔ .(hole_a2_0, gen_nil:.:++:if4_0(x))
The following defined symbols remain to be analysed:
greaters, qsort
They will be analysed ascendingly in the following order:
greaters < qsort
(11) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol greaters.
(12) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
.(
x,
y)) →
++(
qsort(
lowers(
x,
y)),
.(
x,
qsort(
greaters(
x,
y))))
lowers(
x,
nil) →
nillowers(
x,
.(
y,
z)) →
if(
<=(
y,
x),
.(
y,
lowers(
x,
z)),
lowers(
x,
z))
greaters(
x,
nil) →
nilgreaters(
x,
.(
y,
z)) →
if(
<=(
y,
x),
greaters(
x,
z),
.(
y,
greaters(
x,
z)))
Types:
qsort :: nil:.:++:if → nil:.:++:if
nil :: nil:.:++:if
. :: a → nil:.:++:if → nil:.:++:if
++ :: nil:.:++:if → nil:.:++:if → nil:.:++:if
lowers :: a → nil:.:++:if → nil:.:++:if
greaters :: a → nil:.:++:if → nil:.:++:if
if :: <= → nil:.:++:if → nil:.:++:if → nil:.:++:if
<= :: a → a → <=
hole_nil:.:++:if1_0 :: nil:.:++:if
hole_a2_0 :: a
hole_<=3_0 :: <=
gen_nil:.:++:if4_0 :: Nat → nil:.:++:if
Generator Equations:
gen_nil:.:++:if4_0(0) ⇔ nil
gen_nil:.:++:if4_0(+(x, 1)) ⇔ .(hole_a2_0, gen_nil:.:++:if4_0(x))
The following defined symbols remain to be analysed:
qsort
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol qsort.
(14) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
.(
x,
y)) →
++(
qsort(
lowers(
x,
y)),
.(
x,
qsort(
greaters(
x,
y))))
lowers(
x,
nil) →
nillowers(
x,
.(
y,
z)) →
if(
<=(
y,
x),
.(
y,
lowers(
x,
z)),
lowers(
x,
z))
greaters(
x,
nil) →
nilgreaters(
x,
.(
y,
z)) →
if(
<=(
y,
x),
greaters(
x,
z),
.(
y,
greaters(
x,
z)))
Types:
qsort :: nil:.:++:if → nil:.:++:if
nil :: nil:.:++:if
. :: a → nil:.:++:if → nil:.:++:if
++ :: nil:.:++:if → nil:.:++:if → nil:.:++:if
lowers :: a → nil:.:++:if → nil:.:++:if
greaters :: a → nil:.:++:if → nil:.:++:if
if :: <= → nil:.:++:if → nil:.:++:if → nil:.:++:if
<= :: a → a → <=
hole_nil:.:++:if1_0 :: nil:.:++:if
hole_a2_0 :: a
hole_<=3_0 :: <=
gen_nil:.:++:if4_0 :: Nat → nil:.:++:if
Generator Equations:
gen_nil:.:++:if4_0(0) ⇔ nil
gen_nil:.:++:if4_0(+(x, 1)) ⇔ .(hole_a2_0, gen_nil:.:++:if4_0(x))
No more defined symbols left to analyse.